//========================================================================================
//  
//  $File: $
//  
//  Owner: lumpchen@gmail.com
//  
//  $Author: $
//  
//  $DateTime: $
//  
//  $Revision: $
//  
//  $Change: $
//  
//  Copyright 1997-2008 Adobe Systems Incorporated. All rights reserved.
//  
//  NOTICE:  Adobe permits you to use, modify, and distribute this file in accordance 
//  with the terms of the Adobe license agreement accompanying it.  If you have received
//  this file from a source other than Adobe, then your use, modification, or 
//  distribution of it requires the prior written permission of Adobe.
//  
//========================================================================================

#include "VCPlugInHeaders.h"

// General includes:
#include "MenuDef.fh"
#include "ActionDef.fh"
#include "ActionDefs.h"
#include "AdobeMenuPositions.h"
#include "LocaleIndex.h"
#include "PMLocaleIds.h"
#include "StringTable.fh"
#include "ObjectModelTypes.fh"
#include "ShuksanID.h"
#include "ActionID.h"
#include "CommandID.h"
#include "WorkspaceID.h"
#include "WidgetID.h"
#include "BuildNumber.h"
#include "PlugInModel_UIAttributes.h"
#include "PanelList.fh"

#include "Tool.fh"
#include "ToolBoxDefs.h"
#include "ToolboxID.h"
#include "CursorID.h"

//#include "OMTypes.h"
#include "GraphicsID.h"
#include "LayoutUIID.h"
#include "ErrorTableTypes.h" // For UserErrorTable


#include "InterfaceColorDefines.h"
#include "IControlViewDefs.h"
#include "SysControlIDs.h"
#include "Widgets.fh"	// for PalettePanelWidget or DialogBoss

#include "ScriptInfoTypes.fh"
#include "AppFrameworkID.h"


// Project includes:
#include "Barcode4inID.h"
#include "GenericID.h"
#include "TextID.h"

#include "Barcode4inScriptingDefs.h"


#ifdef __ODFRC__

/*  Plugin version definition.
*/
resource PluginVersion (kSDKDefPluginVersionResourceID)
{
	kTargetVersion,
	kBarcode4inPluginID,
	kSDKDefPlugInMajorVersionNumber, kSDKDefPlugInMinorVersionNumber,
	kSDKDefHostMajorVersionNumber, kSDKDefHostMinorVersionNumber,
	kBarcode4inCurrentMajorFormatNumber, kBarcode4inCurrentMinorFormatNumber,
	{ kInDesignProduct},
	{ kWildFS },
	kUIPlugIn,
	kBarcode4inVersion
};

/*  The ExtraPluginInfo resource adds extra information to the Missing Plug-in dialog
	that is popped when a document containing this plug-in's data is opened when
	this plug-in is not present. These strings are not translatable strings
	since they must be available when the plug-in isn't around. They get stored
	in any document that this plug-in contributes data to.
*/
resource ExtraPluginInfo(1)
{
	kBarcode4inCompanyValue,			// Company name
	kBarcode4inMissingPluginURLValue,	// URL 
	kBarcode4inMissingPluginAlertValue,	// Missing plug-in alert text
};

/* Boss class definition.
*/
resource ClassDescriptionTable(kSDKDefClassDescriptionTableResourceID)
{{{
	
	/**
	 This boss class supports two interfaces:
	 IActionComponent and IPMPersist.

	 
	 @ingroup barcode4in
	*/
	Class
	{
		kBarcode4inActionComponentBoss,
		kInvalidClass,
		{
			/** Handle the actions from the menu. */
			IID_IACTIONCOMPONENT, kBarcode4inActionComponentImpl,
			/** Persist the state of the menu across application instantiation.
			Implementation provided by the API.*/
			IID_IPMPERSIST, kPMPersistImpl
		}
	},

	/**
		 This boss class inherits from an API panel boss class, and
		 adds an interface to control a pop-up menu on the panel.
		 The implementation for this interface is provided by the API.

		 
		 @ingroup barcode4in
	*/

	Class
	{
		kBarcode4inPanelWidgetBoss,
		kPalettePanelWidgetBoss,
		{
			/** The plug-in's implementation of ITextControlData with an exotic IID of IID_IPANELMENUDATA.
			Implementation provided by the API.
			*/
			IID_IPANELMENUDATA, kCPanelMenuDataImpl,
		}
	},


			
	/**
		 This boss class implements the dialog for this plug-in. All
		 dialogs must implement IDialogController. Specialisation of
		 IObserver is only necessary if you want to handle widget
		 changes dynamically rather than just gathering their values
		 and applying in the IDialogController implementation.
		 In this implementation IObserver is specialised so that the
		 plug-in's about box is popped when the info button widget
		 is clicked.

		 
		 @ingroup barcode4in
	*/
	Class
	{
		kBarcode4inDialogBoss,
			kDialogBoss,
		{
			/** Provides management and control over the dialog.
			*/
			IID_IDIALOGCONTROLLER, kBarcode4inDialogControllerImpl,
				/** Allows dynamic processing of dialog changes.
				*/
				IID_IOBSERVER, kBarcode4inDialogObserverImpl,
			}

	},
		

	Class
	{
		kBarcode4inScriptProviderBoss,
		kBaseScriptProviderBoss,
		{
			IID_ISCRIPTPROVIDER,kBarcode4inScriptProviderImpl,
			
		}
	},
	
	/** 
	 Provides the tool behavior for this plug-in.
		@ingroup barcode4in
	*/
	Class
	{
		kBarcode4inToolBoss,
		kGenericToolBoss,
		{
			/**
			Provide the implementation for the tool's behavior.
			*/
			IID_ITOOL, kBarcode4inToolImpl,
			/** 
			Identify this boss as a cursor provider service.
			Implementation provided by the API.
			*/
			IID_ICURSORPROVIDER, kBarcode4inCursorProviderImpl,
			/** 
			Persist the state of the tool across application instantiation.
			Implementation provided by the API.
			*/
			IID_IPMPERSIST, kPMPersistImpl,
		}
	},
	
	/** Registers the tracker for this plug-in.
		@ingroup barcode4in
	*/
	Class
	{
		kBarcode4inTrackerRegisterBoss,
		kInvalidClass,
		{
			/** 
			Register the tracker with the application. 
			*/
			IID_ITRACKERREGISTER, kBarcode4inTrackerRegisterImpl,
			/** 
			Identify this boss as a tracker register service.
			Implementation provided by the API.
			*/
			IID_IK2SERVICEPROVIDER, kCTrackerRegisterProviderImpl,
		}
	},

	/** Provides the tracker behavior for the tool in this plug-in.
		@ingroup barcode4in
	*/
	Class
	{
		kBarcode4inTrackerBoss,
		kInvalidClass,
		{
			/** 
			Provide the implementation for the tool's tracker.
			*/
			IID_ITRACKER, kBarcode4inTrackerImpl,
		}
	},

	AddIn
	{
		kIntegratorSuiteBoss,
		kInvalidClass,
		{
			IID_IBARCODE4INSUITE,kBarcode4inSuiteASBImpl,
			
		}
	},
	
		

	AddIn
	{
		kTextSuiteBoss,
		kInvalidClass,
		{
			IID_IBARCODE4INSUITE,kBarcode4inSuiteTextCSBImpl,
			
		}
	},
	
		

	AddIn
	{
		kLayoutSuiteBoss,
		kInvalidClass,
		{
			IID_IBARCODE4INSUITE,kBarcode4inSuiteLayoutCSBImpl,
			
		}
	},
	
		

	AddIn
	{
		kApplicationDefaultSuiteBoss,
		kInvalidClass,
		{
			IID_IBARCODE4INSUITE,kBarcode4inSuiteDefaultsCSBImpl,
			
		}
	},
	
		

	AddIn
	{
		kDocumentDefaultSuiteBoss,
		kInvalidClass,
		{
			IID_IBARCODE4INSUITE,kBarcode4inSuiteDefaultsCSBImpl,
			
		}
	},
	


}}};

/*  Implementation definition.
*/
resource FactoryList (kSDKDefFactoryListResourceID)
{
	kImplementationIDSpace,
	{
		#include "Barcode4inFactoryList.h"
	}
};


/*  Menu definition.
*/
resource MenuDef (kSDKDefMenuResourceID)
{
	{
		// The About Plug-ins sub-menu item for this plug-in.
		kBarcode4inAboutActionID,			// ActionID (kInvalidActionID for positional entries)
		kBarcode4inAboutMenuPath,			// Menu Path.
		kSDKDefAlphabeticPosition,			// Menu Position.
		kSDKDefIsNotDynamicMenuFlag,		// kSDKDefIsNotDynamicMenuFlag or kSDKDefIsDynamicMenuFlag


		// Separator for the popup menu on the panel
		kBarcode4inSeparator1ActionID,
		kBarcode4inInternalPopupMenuNameKey kSDKDefDelimiterAndSeparatorPath,	// :- to mark an item as a separator.
		kBarcode4inSeparator1MenuItemPosition,
		kSDKDefIsNotDynamicMenuFlag,

		// About this plugin submenu for the popup menu on the panel
		kBarcode4inPopupAboutThisActionID,
		kBarcode4inTargetMenuPath
		kBarcode4inAboutThisMenuItemPosition,
		kSDKDefIsNotDynamicMenuFlag,


	// The Plug-ins menu sub-menu items for this plug-in.
		kBarcode4inDialogActionID,
		kBarcode4inPluginsMenuPath,
		kBarcode4inDialogMenuItemPosition,
		kSDKDefIsNotDynamicMenuFlag,
		

	}
};

/* Action definition.
*/
resource ActionDef (kSDKDefActionResourceID)
{
	{
		kBarcode4inActionComponentBoss, 		// ClassID of boss class that implements the ActionID.
		kBarcode4inAboutActionID,	// ActionID.
		kBarcode4inAboutMenuKey,	// Sub-menu string.
		kOtherActionArea,				// Area name (see ActionDefs.h).
		kNormalAction,					// Type of action (see ActionDefs.h).
		kDisableIfLowMem,				// Enabling type (see ActionDefs.h).
		kInvalidInterfaceID,			// Selection InterfaceID this action cares about or kInvalidInterfaceID.
		kSDKDefInvisibleInKBSCEditorFlag, // kSDKDefVisibleInKBSCEditorFlag or kSDKDefInvisibleInKBSCEditorFlag.


		kBarcode4inActionComponentBoss,
		kBarcode4inPopupAboutThisActionID,
		kSDKDefAboutThisPlugInMenuKey,	// Key to the name of this action
		kOtherActionArea,
		kNormalAction,
		kDisableIfLowMem,
		kInvalidInterfaceID,
		kSDKDefInvisibleInKBSCEditorFlag,


		kBarcode4inActionComponentBoss,
		kBarcode4inDialogActionID,		
		kBarcode4inDialogMenuItemKey,		
		kOtherActionArea,			
		kNormalAction,				
		kDisableIfLowMem,	
		kInvalidInterfaceID,		
		kSDKDefVisibleInKBSCEditorFlag,

	}
};

/* Tool Definitions.
*/
resource ToolDef (kIconBarcode4inResource)
{
	kBarcode4inToolBoss,			// classID for tool boss
	kPointerToolBoss,				// classID for tool type(boss of default tool for this type)
	kDoesNotApply,					// classID for parent tool boss
	kSixthAdobeToolsGroup  +  1,	// group number  -  -  was kLayoutToolsGroup in 1.0, is kSixthAdobeToolsGroup in 1.5.
	kSecondAdobeTool,				// tool number
	kDoesNotApply,					// subtool number
	kBarcode4inToolActionID,		// action ID associated with shortcut  -  need to look into this some more				
	kIconBarcode4inResourceID,		// Icon ID
	kBarcode4inPluginID,			// plug - in ID
	kADBEIconSuiteButtonType
};

/*  LocaleIndex
	The LocaleIndex should have indicies that point at your
	localizations for each language system that you are localized for.
*/
/*  String LocaleIndex.
*/
resource LocaleIndex ( kSDKDefStringsResourceID)
{
	kStringTableRsrcType,
	{
		kWildFS, k_enUS, kSDKDefStringsResourceID + index_enUS
		kWildFS, k_enGB, kSDKDefStringsResourceID + index_enUS
		kWildFS, k_deDE, kSDKDefStringsResourceID + index_enUS
		kWildFS, k_frFR, kSDKDefStringsResourceID + index_enUS
		kWildFS, k_esES, kSDKDefStringsResourceID + index_enUS
		kWildFS, k_ptBR, kSDKDefStringsResourceID + index_enUS
		kWildFS, k_svSE, kSDKDefStringsResourceID + index_enUS
		kWildFS, k_daDK, kSDKDefStringsResourceID + index_enUS
		kWildFS, k_nlNL, kSDKDefStringsResourceID + index_enUS
		kWildFS, k_itIT, kSDKDefStringsResourceID + index_enUS
		kWildFS, k_nbNO, kSDKDefStringsResourceID + index_enUS
		kWildFS, k_fiFI, kSDKDefStringsResourceID + index_enUS
		kInDesignJapaneseFS, k_jaJP, kSDKDefStringsResourceID + index_jaJP
	}
};

resource LocaleIndex (kSDKDefStringsNoTransResourceID)
{
	kStringTableRsrcType,
	{
		kWildFS, k_Wild, kSDKDefStringsNoTransResourceID + index_enUS
	}
};

resource StringTable (kSDKDefStringsNoTransResourceID + index_enUS)
{
	k_enUS,									// Locale Id
	kEuropeanMacToWinEncodingConverter,		// Character encoding converter
	{
		// No-Translate strings go here:

		kBarcode4inInternalPopupMenuNameKey,	kBarcode4inInternalPopupMenuNameKey,		// No need to translate, internal menu name.

	}
};




/*  Panel LocaleIndex.
*/
resource LocaleIndex (kSDKDefPanelResourceID)
{
	kViewRsrcType,
	{
		kWildFS, k_Wild, 	kSDKDefPanelResourceID + index_enUS
	}
};


/*  Type definition.
*/
type Barcode4inPanelWidget(kViewRsrcType) : PalettePanelWidget(ClassID = kBarcode4inPanelWidgetBoss)
{
	CPanelMenuData;
};

/*  PanelList definition.
*/
resource PanelList (kSDKDefPanelResourceID)
{
	{
		// 1st panel in the list
		kSDKDefPanelResourceID,		// Resource ID for this panel (use SDK default rsrc ID)
		kBarcode4inPluginID,			// ID of plug-in that owns this panel
		kIsResizable,
		kBarcode4inPanelWidgetActionID,	// Action ID to show/hide the panel
		kBarcode4inPanelTitleKey,	// Shows up in the Window list.
		"",							// Alternate menu path of the form "Main:Foo" if you want your palette menu item in a second place
		0.0,						// Alternate Menu position Alternate Menu position for determining menu order
		0,0,						// Rsrc ID, Plugin ID for a PNG icon resource to use for this palette
		c_Panel
	}
};

/*  PanelView definition.
	The view is not currently localised: therefore, it can reside here.
	However, if you wish to localise it, it is recommended to locate it in one of
	the localised framework resource files (i.e. Barcode4in_enUS.fr etc.).
*/
resource Barcode4inPanelWidget(kSDKDefPanelResourceID + index_enUS)
{
	__FILE__, __LINE__,					// Localization macro
	kBarcode4inPanelWidgetID,			// WidgetID
	kPMRsrcID_None,						// RsrcID
	kBindNone,							// Binding (0=none)
	0, 0, 207, 32,						// Frame: left, top, right, bottom.
	kTrue, kTrue,						// Visible, Enabled
	kFalse,								// Erase background
	kInterfacePaletteFill,				// Erase to color
	kFalse,								// Draw dropshadow
	kBarcode4inPanelTitleKey,			// Panel name
	{
		StaticTextWidget
		(
			0,								// WidgetId (default=0)
			 kSysStaticTextPMRsrcId,		// RsrcId
			kBindNone,						// Frame binding
			5, 10, 202, 27,					// Frame: left, top, right, bottom.
			kTrue, kTrue,					// Visible, Enabled
			kAlignLeft, kEllipsizeEnd, kTrue		// Alignment, ellipsize style, convert ampersands
			kBarcode4inStaticTextKey,		// Initial text.
			0								// No associated widget
		),
	}

	kBarcode4inInternalPopupMenuNameKey		// Popup menu name (internal)
};


/*  Dialog LocaleIndex.
*/
resource LocaleIndex (kSDKDefDialogResourceID)
{
   kViewRsrcType,
	{
		kWildFS,	k_Wild, kSDKDefDialogResourceID + index_enUS
	}
};

/*  Type definition.
*/
type Barcode4inDialogWidget(kViewRsrcType) : DialogBoss(ClassID = kBarcode4inDialogBoss)
{
};

/*  Dialog definition.
	This view is not localised: therefore, it can reside here.
	However, if you wish to localise it, it is recommended to locate it in one of
	the localised framework resource files (i.e. Barcode4in_enUS.fr etc.) and
	update your Dialog LocaleIndex accordingly.
*/
resource Barcode4inDialogWidget (kSDKDefDialogResourceID + index_enUS)
{
	__FILE__, __LINE__,
	kBarcode4inDialogWidgetID,	// WidgetID
	kPMRsrcID_None,				// RsrcID
	kBindNone,					// Binding
	0, 0, 388,112,				// Frame (l,t,r,b)
	kTrue, kTrue,				// Visible, Enabled
	kBarcode4inDialogTitleKey,	// Dialog name
	{
	//<FREDDYWIDGETDEFLISTUS>
		DefaultButtonWidget
		(
			kOKButtonWidgetID,		// WidgetID
			kSysButtonPMRsrcId,		// RsrcID
			kBindNone,				// Binding
			292, 16, 372, 36,		// Frame (l,t,r,b)
			kTrue, kTrue,			// Visible, Enabled
			kSDKDefOKButtonApplicationKey,	// Button text
		),
		CancelButtonWidget
		(
			kCancelButton_WidgetID,	// WidgetID
			kSysButtonPMRsrcId,		// RsrcID
			kBindNone,				// Binding
			292, 46, 372, 66,		// Frame (l,t,r,b)
			kTrue, kTrue,			// Visible, Enabled
			kSDKDefCancelButtonApplicationKey,	// Button name
			kTrue,					// Change to Reset on option-click.
		),

	//</FREDDYWIDGETDEFLISTUS>

	},
};
/*

/*  Scripting definition
	In InDesign/InCopy, scripting resources are defined via ODFRez statements for cross-platform compatibility.
*/
resource VersionedScriptElementInfo(2)
{
	// Contexts
	{
		// Scripting support added at InDesign CS 2.0
        kFiredrakeScriptVersion, kCoreScriptManagerBoss, kInDesignAllLanguagesFS, k_Wild,
		kFiredrakeScriptVersion, kCoreScriptManagerBoss, kInCopyAllLanguagesFS, k_Wild,
	}
	
	// Elements
	{
		// Specifies an Method
		Method
		{
			kBarcode4inMethodScriptElement,
			e_Speak,
			"speak",
			"Displays what you say in dialog",
			VoidType,
			{
				p_Said, "said", "Holds a string", StringType, kRequired,
			}
		}

		// Specifies a property
		Property
		{
			kBarcode4inPropertyScriptElement,
			p_Response,
			"response",
			"Describes user response to dialog",
			StringType,
			{}
			kNoAttributeClass,
		}
		
		// Connects this plug-in's methods and properties to scripting.
		Provider
		{
			kBarcode4inScriptProviderBoss,	// provider boss ID
			{
				Object{ kApplicationObjectScriptElement },
				Method{ kBarcode4inMethodScriptElement },
				Property{ kBarcode4inPropertyScriptElement, kReadOnly },
			}
		}
	}
};

/*
// Add the ScriptID that identifies the tool to kkToolBoxEnumScriptElement
*/
resource VersionedScriptElementInfo( 10 ) 
{ 
	//Contexts 
	{ 
		kCS5ScriptVersion, kCoreScriptManagerBoss, kInDesignAllLanguagesFS,k_Wild, 
	} 
	//Elements 
	{ 
		Enumerator 
		{ 
			kToolBoxEnumScriptElement,
			{ 
				en_Barcode4inTool,	"barcode4in tool",	"The barcode tool", 
			} 
		} 
	} 
};	

#endif // __ODFRC__

#include "Barcode4in_enUS.fr"
#include "Barcode4in_jaJP.fr"

//  Code generated by DollyXs code generator
